home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13885 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: mail2news.demon.co.uk!dfdesign.demon.co.uk
  2. From: Dominic Feeley <dom@dfdesign.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: STDIO.H
  5. Followup-To: comp.os.msdos.programmer
  6. Date: Wed, 10 Apr 96 11:09:19 GMT
  7. Organization: DF Designs
  8. Message-ID: <829134559snz@dfdesign.demon.co.uk>
  9. References: <4ke6d8$r42@newsbf02.news.aol.com> <316ADBEA.3FE8@willows.com>
  10. Reply-To: dom@dfdesign.demon.co.uk
  11. X-NNTP-Posting-Host: dfdesign.demon.co.uk
  12. X-Newsreader: Demon Internet Simple News v1.30
  13. X-Mail2News-Path: dfdesign.demon.co.uk
  14.  
  15. In article <316ADBEA.3FE8@willows.com>
  16.        tarang@willows.com "Tarang Deshpande" writes:
  17. > JeffSCman wrote: [ and I snipped ]
  18. > >
  19. > > In STDIO.H the constant FOPEM_MAX is defined using the constant
  20. > > _NFILE_ which == 20.  This limits the number of files that I can
  21. > > open at one time to 20 files. Can I increase this value safely ??
  22. >
  23. > No.  MS-DOS has a limit of 20 open file handles at a time.  Even if you did
  24. > enlarge the number when you attempted to open the 20th file you would get
  25. > back an error.  Note that you can not actually open 20 files since there are
  26. > some files open automatically.
  27.  
  28. Followups set to comp.os.msdos.programmer, where this belongs.
  29. It is probably also in their FAQ, as it certainly is one.
  30.  
  31. It is definately covered in the comp.lang.c FAQ, in section:
  32.  
  33.  19.18:    I'm getting an error, "Too many open files".  How can
  34.               I increase the allowable number of simultaneously open files?
  35.  
  36. It doesn't give an answer, but then I would not expect it to.
  37.  
  38. The default number of MS-DOS filehandles is 20, but it is easy to change.
  39. However you cannot change it in C
  40.  
  41. Move the new file handle maximum into register bx, move 0x67 into ah
  42. and execute int 0x21
  43. Your compiler will likely have functions and unions to allow this.
  44.  
  45. Obviously your FILES= stuff in CONFIG.SYS needs to be set appropriately.
  46.  
  47. As an aside, could people please leave in an email address for posts
  48. they quote. This should have gone to straigt to Jeff, but I cannot
  49. contact him from the info given.
  50.  
  51. -- 
  52. Dominic Feeley
  53.